package com.kkwrite.regimen.common.entity.dto.login;

import java.io.Serializable;

/**
 *
 * @author jinying
 * 
 */
public class ChangePasswordInDTO implements Serializable {

	private static final long serialVersionUID = 4491871295458178560L;
	private String username;
	private String phoneNum;
	private String password;
	private String passwordVerify;

	public boolean isInvalid() {
		if (isBlank(username) && isBlank(phoneNum)) {
			return true;
		}
		if (isBlank(password)) {
			return true;
		}
		return !isBlank(phoneNum);
	}

	private boolean isBlank(String string) {
		return string == null || string.trim().isEmpty();
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPhoneNum() {
		return phoneNum;
	}

	public void setPhoneNum(String phoneNum) {
		this.phoneNum = phoneNum;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPasswordVerify() {
		return passwordVerify;
	}

	public void setPasswordVerify(String passwordVerify) {
		this.passwordVerify = passwordVerify;
	}

	@Override
	public String toString() {
		return "ChangePasswordInDTO [username=" + username + ", phoneNum="
				+ phoneNum + ", password=" + password + ", passwordVerify="
				+ passwordVerify + "]";
	}

}
